package BlackChurch.DM;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class VS extends Activity implements OnItemClickListener{
    UIManager.DataModel dm;
    ListView lv;
    ArrayAdapter<String> adapter;
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	dm = new UIManager.DataModel();
    	lv = new ListView(this);
    	adapter =new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,dm.loadData());
    	lv.setAdapter(adapter);
    	lv.setOnItemClickListener(this);
    	setContentView(lv);   	
    }
	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		//Log.d(String.valueOf(arg2), "Hello World!");
		setTitle(String.valueOf(dm.getTitle(arg2)));
		Intent intent = new Intent();
		switch(arg2){
		case 0:intent.setClass(VS.this, UserInfo_Activity.class);break;
		case 1:intent.setClass(VS.this, SystemInfoActivity.class);break;
		case 2:intent.setClass(VS.this, TimeDivider_Activity.class);break;
		case 3:break;
		case 4:break;
		default:break;
		}
		
        //intent.setClass(VS.this, UserInfo_Activity.class);
        startActivity(intent);
        finish();            

		
	}
    
    
	
	
}